<template>
  <div class="recommend">
    <h1 class="recommend-title">本周热门榜单</h1>
    <ul>
      <router-link
        class="item border-bottom"
        v-for="item in recommendList"
        :key="item.id"
        tag="li"
        :to="`/detail/${item.id}`"
      >
        <img class="item-img" :src="item.imgUrl">
        <div class="item-info">
          <h2 class="item-title">{{item.title}}</h2>
          <p class="item-desc">{{item.desc}}</p>
          <button class="item-button">查看详情</button>
        </div>
      </router-link>
    </ul>
  </div>
</template>

<script>
export default {
  name: 'HomeRecommed',
  props: {
    recommendList: {
      type: Array
    }
  }
}
</script>

<style lang="stylus" scoped>
  @import '~styles/mixins.styl'
  .recommend-title
    margin-top: .1rem
    line-height .8rem
    background-color #eee
    text-indent .2rem
  .item
    display: flex
    overflow hidden
    width: 100%
    height 1.9rem
    .item-img
      height 1.7rem
      width 1.7rem
      padding .1rem
    .item-info
      flex 1
      padding .1rem
      min-width 0
      .item-title
        line-height .54rem
        font-size .32rem
        ellipsis()
      .item-desc
        ellipsis()
        line-height .4rem
        color #ccc
      .item-button
        margin-top .16rem
        line-height .44rem
        background-color #ff9300
        padding 0 .1rem
        border-radius .06rem
</style>
